package com.spring.cloud.examples.service.impl;

import com.spring.cloud.examples.mapper.Service2Mapper;
import com.spring.cloud.examples.service.Service2;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service
public class Service2Impl implements Service2 {

    @Autowired
    private Service2Mapper service2Mapper;

    /**
     * 注意 在这里不加事务注解,由于在server1中已经加了GlobalTransaction注解 这里什么都别加
     */
    @Override
    public void insertService2() {
        service2Mapper.insertService2(UUID.randomUUID().toString());

    }
}
